package com.norma.macaron.common.model.enums;

import lombok.ToString;

/**
 * @Author zhangchaofeng
 * @Date 16:04 2020/6/4 0004
 * @description 通用返回码
 **/
@ToString
public enum CommonCode implements ResultCode {
    INVALID_PARAM(10003,"非法参数!"),
    SUCCESS(10000,"操作成功!"),
    FAIL(11111,"操作失败!"),
    UNAUTHENTICATED(10001,"此操作需要登陆系统!"),
    UNAUTHORISE(10002,"权限不足,无权操作!"),
    SERVER_ERROR(99999,"抱歉,系统繁忙,请稍后重试!");

    Integer code;
    String message;

    CommonCode(Integer code,String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
